export default ({ isHMR, app, store, error }) => {
  if (isHMR) return //是否是通过模块热替换 webpack hot module replacement (仅在客户端以 dev 模式)
  // fallbackLocale-没有英文的时候默认中文语言
  let locale = app.$cookies.get("lang") || app.i18n.fallbackLocale
  if (!store.state.locales.includes(locale)) {
    // return error({ message: "This page could not be found.", statusCode: 404 });
    locale = "en-US"
  }
  app.i18n.locale = locale
  store.commit("SET_LANG", locale)
  app.$cookies.set("lang", locale)
}
